package com.vx.aspect;

import org.apache.log4j.Logger;

public class ExecptionAspect {
	public void exceptionLogger(Exception ex){
//		 1 获得当前异常的堆栈信息
		  StackTraceElement[] els =ex.getStackTrace();
//		 2 需要放入：第1行内容（java.lang.NullPointerException  -- els[0]
		  Logger logger = Logger.getLogger(this.getClass());
		  logger.info(ex.getClass().getName());
		  logger.info(els[0]);
	}
}
